package cn.shyouchi.wuguanjia.android.ui.report;

import android.content.Intent;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.ui.attendance.report.StaffPostEntity;
import cn.shyouchi.wuguanjia.android.ui.attendance.report.StaffReportActivity;

/**
 * Created by Eenie on 2017/2/22 at 14:11
 * Email: 472279981@qq.com
 * Des:
 */

public class PostReportAdapter extends BaseQuickAdapter<StaffPostEntity.ResultMessageBean, BaseViewHolder> {
    public PostReportAdapter(List<StaffPostEntity.ResultMessageBean> data) {
        super(R.layout.item_sel_post_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, final StaffPostEntity.ResultMessageBean bean) {
        holder.setText(R.id.tv_post_name, bean.getPost());
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, StaffReportActivity.class);
                intent.putExtra("post", bean);
                mContext.startActivity(intent);
            }
        });

    }
}
